#include <stdio.h>

int main() {
    int n;
    while(scanf("%d",&n)!= EOF) {
        int sum=0;
        while(n){
             int temp = n%10; //5548%10=8;
             if(temp%2 == 0) {
                sum += temp;  //0+8;
             }
             n=n/10;          //5548/10=554;
        }
        printf("%d\n\n",sum);
    }
    return 0;
}